#ifndef RUNTESTING_H
#define RUNTESTING_H

#include <QDialog>
#include <QSQLDatabase>
#include <QProcess>
#include "helper.h"
#include "ui_runtesting.h"

class RunTesting : public QDialog
{
	Q_OBJECT

public:
	RunTesting(QWidget *parent, QString _fileName, int _lessontypeid, int _variantid, int _modid = -1, int _complexityid = -1);
	~RunTesting();

	static const int TestFail = 0;
	static const int TestSuccess = 1;
	static const int TestIgnore = 2;

	QString varmodComments;
	QString attemptComments;
	


private:
	Ui::RunTestingClass ui;
	int lessontypenum, variantnum, modnum;
	QString fileName;
	int lessontypeid, variantid, modid, complexityid;
	QProcess tstproc;

	//before any ending of testing
	void saveComments();

private slots:

	//helper buttons
	void showTestInput();
	void runExe();

	//end of testing
	void tstSucc();
	void tstFail();
	void tstIgnore();

	//debugging
	void tstError(QProcess::ProcessError err);
};

#endif // RUNTESTING_H
